package com.shop2cn.iapi.sqdistributor.parameter.request.pojo;

import java.math.BigDecimal;

public class DistributorCommission {

	/**
	 * 分销员序号索引
	 */
	private Integer distributorIndex;
	
	/**
	 * 分销员1级分佣比例
	 */
	private BigDecimal layer1Rate;
	
	/**
	 * 分销员2级分佣比例
	 */
	private BigDecimal layer2Rate;
	
	/**
	 * 分销员3级分佣比例
	 */
	private BigDecimal layer3Rate;

	public Integer getDistributorIndex() {
		return distributorIndex;
	}

	public void setDistributorIndex(Integer distributorIndex) {
		this.distributorIndex = distributorIndex;
	}

	public BigDecimal getLayer1Rate() {
		return layer1Rate;
	}

	public void setLayer1Rate(BigDecimal layer1Rate) {
		this.layer1Rate = layer1Rate;
	}

	public BigDecimal getLayer2Rate() {
		return layer2Rate;
	}

	public void setLayer2Rate(BigDecimal layer2Rate) {
		this.layer2Rate = layer2Rate;
	}

	public BigDecimal getLayer3Rate() {
		return layer3Rate;
	}

	public void setLayer3Rate(BigDecimal layer3Rate) {
		this.layer3Rate = layer3Rate;
	}
	
	public static DistributorCommission createStandardDistributorCommission() {
		
		DistributorCommission distributorCommission = new DistributorCommission();
		
		distributorCommission.setDistributorIndex(0);
		distributorCommission.setLayer1Rate(new BigDecimal("0.01"));
		distributorCommission.setLayer2Rate(new BigDecimal("0.01"));
		distributorCommission.setLayer3Rate(new BigDecimal("0.01"));
		
		return distributorCommission;
	}
	
	public DistributorCommission withDistributorLevelIndex(Integer distributorLevelIndex) {
		
		this.setDistributorIndex(distributorLevelIndex);
		
		return this;
	}
	
	public DistributorCommission withLayer1Rate(BigDecimal layer1Rate) {
		
		this.setLayer1Rate(layer1Rate);
		
		return this;
	}
	
	public DistributorCommission withLayer2Rate(BigDecimal layer2Rate) {
		
		this.setLayer2Rate(layer2Rate);
		
		return this;
	}
	
	public DistributorCommission withLayer3Rate(BigDecimal layer3Rate) {
		
		this.setLayer3Rate(layer3Rate);
		
		return this;
	}
}
